<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">
	
	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
    <link rel="stylesheet" type="text/css" href="/css/bbs.css"/>
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			
		});

		// 삭제 버튼 눌렀을때
		function remove(idx) {
			if (confirm('글을 정말 삭제하시겠습니까?')) {
				location.href = "/bbs/remove_ok?idx="+idx;
			}
		}
		
		// 덧글 삭제 버튼 눌렀을때
		function remove_reply(idx,seq) {
			if (confirm('덧글을 정말 삭제하시겠습니까?')) {
				location.href = "/bbs/remove_reply_ok?idx="+idx+"&seq="+seq;
			}
		}
	</script>
</head>
<body>
<div id="wrap">
	<!-- Contents -->
	<div class="read">
		<h2>스타 상세 정보</h2>
		<div class="readTit">
			<div class="tit">
				<dl>
					<dt><?=$content['subject']?><span class="user_name"><?=$content['nickname']?></span> | <?=$content['user_id']?></dt>
					<dd><?=substr($content['create_dt'], 0,10)?></dd>
					<dd><span>조회</span><?=$content['hit']?></dd>
					<dd><input type="button" value="삭제" onclick="remove('<?=$content['idx']?>')"/></dd>
				</dl>
			</div>
		</div>					
		<div class="readContents">
			<span><?=str_replace("\n", "<br/>", $content['content'])?></span>
			<br/><br/>
<?	foreach ($content['file'] as $file_item) : ?>
			<img src="<?=$file_item['file_url']?>" />
<?	endforeach ?>
		</div>
		<div>
			<b>↓↓↓HTML 소스↓↓↓</b><br>
			<textarea cols="100" rows="10"><?=$content['content']?></textarea>
		</div>
		
		<!--덧글영역-->
		<div class="comment">
			<dl class="num">
				<dt>덧글의견<span>(<?=count($reply_list)?>)</span></dt>
			</dl>
			<div class="commentList">
				<?	foreach ($reply_list as $item) : ?>
				<dl>
					<dt class="user_name"><?=$item['nickname']?><span><?=$item['create_dt']?></span></dt>
					<dd>
						<?=str_replace("\n", "<br/>", $item['content'])?>
						<a href="javascript:;" onclick="remove_reply('<?=$item['idx']?>','<?=$item['seq']?>')">[삭제]</a>
					</dd>
				</dl>
				<?	endforeach ?>
			</div>
			<div class="commentWrite">
				<form name="frm" id="frm" method="post" action="/bbs/reply_ok">
					<input type="hidden" name="idx" id="idx" value="<?=$content['idx']?>" />
			   		<dl>
						<dt class="user_name" ><?=$sess_userinfo['nickname'];?></dt>
						<dt ><textarea name="content" id="comment"></textarea></dt>
						<dd><input type="submit" value="글쓰기" /></dd>
					</dl>
				</form>
			</div>
		</div>
		<!--//덧글영역-->
	</div>
	<!--// Contents -->
	
</div>
</body>
</html>